using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;

using Jamila2.Tools;

public class MultiLingualEngine 
{    
	public static MultiLingualFactory GetMultiLingualFactory(System.Web.UI.Page CurrentPage, string Language) 
	{
        string FileName = CurrentPage.Request.CurrentExecutionFilePath.Substring(CurrentPage.Request.CurrentExecutionFilePath.LastIndexOf("/"));
        FileName = FileName.Replace("/", "");
        FileName = (FileName.IndexOf("?") > 0) ? FileName.Substring(0, FileName.IndexOf("?")) : FileName;
        StringBuilder ResouceFileName = new StringBuilder(CurrentPage.Server.MapPath("MultiLanguage") + "\\" + FileName + "-" + Language + ".xml");

        return (new MultiLingualFactory(ResouceFileName.ToString()));
	}
}
